home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
PRG
/
NGL2.0.1J(68k).sit
/
NGL2.0.1J(68k)
/
Font Sample
/
Font_Sample.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-19
|
2KB
|
96 lines
/*============================================================
N_Font サンプルプログラム
============================================================*/
#include "N_Library.h"
void Int_Main_Loop(void);
void Begin_Timer_Int(void* Int_Routine,short Tm_Counter);
void Stop_Timer_Int(void);
short Data_Rsrc = 0;
WindowPtr window;
//表示する数字
short x = 640;
char mes[] = "WELCOME TO N GAME LIBRARY! THANK YOU FOR DOWNLOADING/ THIS IS A FONT SAMPLE/@";
Str255 putmes = "¥pN";
short mes_count = 0;
short dot_count = 14;
short style = 0;
void main(void)
{
ToolboxInit();
ColorCheck(); //画面モードチェック&切り替え
HideMenuBar();
HideCursor();
window = GetNewWindow (128,nil,(WindowPtr)-1L );
SetPort((GrafPtr)window);
N_Window_Set(window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),640,480);
Open_Resource_File(128,1,&Data_Rsrc);
N_Sp_Make(640,16); //スプライトスクリーン作成
N_Cel_Make(65536); //セル用作業バッファ作成
N_Font_Init();
N_Sprite_Set(130,11,12,16,1,13,4,0);
N_Font_Set(0,0,0,0x80000000,0); //Font Set 0 重ね合わせ・通常表示
N_Font_Set(1,0x80000000+11,0,0x80000000+26+11,0x80000000+37+11); //Font Set 1
N_Pict_Draw(128,0,0,(GrafPtr)Main_Window,true); //背景(PICT 128)をかいておく
Close_Resource_File(&Data_Rsrc);
Begin_Timer_Int(Int_Main_Loop,17); //タイマー割り込み START
do //マウスボタンを押せば終了
{
}
while (!Button());
Stop_Timer_Int(); //タイマー割り込み STOP
ShowCursor();
ShowMenuBar();
ColorRevert();
}
void Int_Main_Loop(void)
{
char me;
Rect sc_rect;
if (dot_count == 0)
{
dot_count = 18;
me = mes[mes_count];
if (me == '@')
{
me = ' ' ;
mes_count = 0;
style++;
if (style == 2) style = 0;
}
else
{
*(putmes+1) = me;
N_Font_Put(putmes,626,430,14,1,0,30);
mes_count++;
if (style == 1)
{
SetRect(&sc_rect,622,442,640,430+16);
ScrollRect(&sc_rect,-1,0,nil);
SetRect(&sc_rect,622,438,640,430+16);
ScrollRect(&sc_rect,-1,0,nil);
SetRect(&sc_rect,622,434,640,430+16);
ScrollRect(&sc_rect,-1,0,nil);
}
}
}
dot_count--;
SetRect(&sc_rect,0,430,640,430+16);
ScrollRect(&sc_rect,-1,0,nil);
}